#pragma once
#ifndef __G_TRANSFORM_3_H__
#define __G_TRANSFORM_3_H__

#include "GVector3.h"
#include "GVector4.h"
#include "GMatrix3x3.h"
#include "GMatrix4x4.h"
#include "GCoordFrame3.h"
#include "GQuaternion.h"

#include "GRay3.h"
#include "GDisk.h"
#include "GPlane.h"
#include "GSphere.h"
#include "GBoxAligned.h"
#include "GBoxOriented.h"
#include "GTriangle3.h"
namespace GMath
{

	enum GTransformationType
	{
		G_TT_SCALE			= 0,
		G_TT_ROTATION		= 1,
		G_TT_TRANSLATION	= 2,
		G_TT_VIEW			= 3,
		G_TT_PROJECTION		= 4,
		G_TT_CLIP			= 5,
		G_TT_TEXTURE		= 6
	};

	class GTransform3
	{
		public:
			static void		Transform(OUTPUT GRay3& Output, const GRay3& Ray, const GCoordFrame3& Frame);
			static void		Transform(OUTPUT GRay3& Output, const GRay3& Ray, const GVector3& Scale, const GQuaternion& Rotation, const GVector3& Translation);

			static void		Transform(OUTPUT GDisk& Output, const GDisk& Disk, const GCoordFrame3& Frame);
			static void		Transform(OUTPUT GDisk& Output, const GDisk& Disk, const GVector3& Scale, const GQuaternion& Rotation, const GVector3& Translation);
			
			static void		Transform(OUTPUT GPlane& Output, const GPlane& Plane, const GCoordFrame3& Frame);
			static void		Transform(OUTPUT GPlane& Output, const GPlane& Plane, const GVector3& Scale, const GQuaternion& Rotation, const GVector3& Translation);
			
			static void		Transform(OUTPUT GSphere& Output, const GSphere& Sphere, const GCoordFrame3& Frame);
			static void		Transform(OUTPUT GSphere& Output, const GSphere& Sphere, const GVector3& Scale, const GQuaternion& Rotation, const GVector3& Translation);
			
			static void		Transform(OUTPUT GTriangle3& Output, const GTriangle3& Triangle, const GCoordFrame3& Frame);
			static void		Transform(OUTPUT GTriangle3& Output, const GTriangle3& Triangle, const GVector3& Scale, const GQuaternion& Rotation, const GVector3& Translation);

			static void		Transform(OUTPUT GBoxAligned& Output, const GBoxAligned& Box, const GCoordFrame3& Frame);
			static void		Transform(OUTPUT GBoxAligned& Output, const GBoxAligned& Box, const GMatrix4x4& Transformation);
			static void		Transform(OUTPUT GBoxAligned& Output, const GBoxAligned& Box, const GVector3& Scale, const GQuaternion& Rotation, const GVector3& Translation);

			static void		Transform(OUTPUT GBoxOriented& Output, const GBoxOriented& Box, const GCoordFrame3& Frame);
			static void		Transform(OUTPUT GBoxOriented& Output, const GBoxOriented& Box, const GMatrix4x4& Transformation);
			static void		Transform(OUTPUT GBoxOriented& Output, const GBoxOriented& Box, const GVector3& Scale, const GQuaternion& Rotation, const GVector3& Translation);
			
			static void		CreateTranslation(OUTPUT GMatrix4x4& Output, const GVector3& Translation);

			static void		CreateScale(OUTPUT GMatrix4x4& Output, const GVector3& Scale);

			static void		CreateRotationX(OUTPUT GMatrix4x4& Output, float Value);
			static void		CreateRotationY(OUTPUT GMatrix4x4& Output, float Value);
			static void		CreateRotationZ(OUTPUT GMatrix4x4& Output, float Value);
			static void		CreateRotationXYZ(OUTPUT GMatrix4x4& Output, const GVector3& Rotation);

			static void		CreateLocal(OUTPUT GMatrix4x4& Output, const GVector3& Scale, const GQuaternion& Rotation, const GVector3 Position);

			static void		CreateShear(OUTPUT GMatrix4x4& Output, const GVector2& AxisXFactorYZ, const GVector2& AxisYFactorXZ, const GVector2& AxisZFactorXY);
			static void		CreateReflection(OUTPUT GMatrix4x4& Output, const GPlane& Plane);

			static void		CreateTBN(OUTPUT GMatrix3x3& Output, const GCoordFrame3& Frame);
			static void		CreateTBN(OUTPUT GMatrix3x3& Output, const GVector3& RightU, const GVector3& UpV, const GVector3& FrontN);

			static void		CreateView(OUTPUT GMatrix4x4& Output, const GCoordFrame3& Frame);
			static void		CreateView(OUTPUT GMatrix4x4& Output, const GVector3& Position, const GVector3& Right, const GVector3& Up, const GVector3& Front);

			static void		CreateProjOblique(OUTPUT GMatrix4x4& Output, float Angle);
			static void		CreateProjOrthographic(OUTPUT GMatrix4x4& Output, GUInt32 Width, GUInt32 Height, float ZFar, float ZNear);
			static void		CreateProjPerspective(OUTPUT GMatrix4x4& Output, GUInt32 Width, GUInt32 Height, float ZFar, float ZNear, float FovVertical);
	
	};

}

#endif